import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
import persistedstate from 'vuex-persistedstate' // 数据持久化插件
Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user
  },
  getters,
  // 插件配制
  plugins: {
    //  需要持久化的数据:某模块全持久化，直接模块名
    // 某模块某数据持久化，模块名.属性名
    paths: ['user.state.token']
  }
})

export default store
